home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / Amos / AMOSList-1097 / AMOSLIST / text0046.txt < prev    next >
Encoding:
Text File  |  1998-06-24  |  1.2 KB  |  39 lines

  1. >Hi!
  2.  
  3. Hi Peter
  4.  
  5. >Is there a smooth way to sort 20 variables???
  6.  
  7. If your using arrays (I think you are from the example) your better off
  8. to use 'for` loops.  Is this for a high score table ?  Anyways heres
  9. some example code.
  10.  
  11. Dim HISCORES(19),HINAME$(19) } At the beginning of the program 
  12.  
  13. For C=19 To 0 Step -1                      }  Checks where your
  14.    If SCORE>HISCORES(C) : POS=C : End If   }  score ranks in the
  15. Next C                                     }  high score table
  16. '
  17. For C=18 To POS Step -1
  18.    HISCORES(C+1)=HISCORES(C) : HINAME$(C+1)=HINAME$(C) } Knocks all the
  19. Next C                                     } down one from your pos
  20. '
  21. HISCORES(POS)=SCORE : HINAME$(POS)=NM$     }  Puts your details into
  22.                                            }  high score
  23.  
  24. If you need proper high score code then just email me personally and 
  25. I`ll give you some.
  26.  
  27. Anthony Sherratt
  28.  
  29. -- 
  30.  ÷    _       ____ ÷ ____`------------------------------------------°
  31.      /.\  ÷  / __/  / __,\      *http://www.talk-101.com/users/asp*
  32.   ,_/ ¡_\_ _/__ \_ /  ___/  O°····································°O
  33.  ,_____/  Y_      Y_  ¡  ·  o   #Monty The Wolf - OUT VERY SOON#     o
  34.   |   ¡   [ ] |   [ ] | -÷- Oo.....................................O
  35.   :   :   *DESIGN*  :   :  ·
  36.  
  37.  
  38.  
  39.